
#include "esp32_com.h"
#include "page_com.h"

//---------------------------------------------------
void gui_sample() {
  //  REGINTER_PAGE(PAGE_Login, login);
  //  REGINTER_PAGE(PAGE_Menun, menun);
  //  REGINTER_PAGE(PAGE_Watch, watch);
  page_manager_init(1000);
  page_manager_reg(PAGE_Login, page_user_login_load, page_user_login_loop, NULL, page_user_login_event);
  page_manager_reg(PAGE_Menun, page_user_menun_load, NULL, NULL, page_user_menun_event);
  page_manager_reg(PAGE_Watch, page_user_watch_load, NULL, NULL, page_user_watch_event);
}

//=========================================================
//=========================================================
void setup() {
  Serial.begin(115200);
  esp32_hal_init();
  esp32_display_init();

  gui_sample();
  esp32_key_rcb(page_manager_event);
}

//=========================================================
//=========================================================
void loop() {
  esp32_hal_loop();
  esp32_display_loop();
  page_manager_loop();
  delay(5);
}
